/**
 * selectionchange事件
 * 设置光标
 */
// 注意：编辑层需要和事件处理打交道
export class SelectionchangeEvent {
    constructor (editor) {
        this.editor = editor;
    }
    selectionchangeEvent_() {
        const selection = document.getSelection()
        if (selection) {
            this.editor.setSelection(selection.anchorOffset, selection.focusOffset)
        }
    }
    addListeners() {
        window.document.addEventListener('selectionchange', this.selectionchangeEvent_.bind(this))
    }
}
export default SelectionchangeEvent;
